package com.shop.admin.service.impl;

import com.shop.Result.LdbzResult;
import com.shop.admin.service.AdminItemService;
import com.shop.api.feign.ItemSerevice;
import com.shop.pojo.LdbzItem;
import io.seata.spring.annotation.GlobalTransactional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

@GlobalTransactional
public class AdminItemServiceImpl implements AdminItemService {

    private static final Logger logger = LoggerFactory.getLogger(AdminItemServiceImpl.class);

    @Autowired
    private ItemSerevice itemSerevice;
    @Override
    public LdbzResult countItem() {
        return itemSerevice.countItem(null);
    }

    @Override
    public LdbzResult selectByKey(long id) {
        return itemSerevice.selectByKey(id);
    }

    @Override
    public LdbzResult getItemList(LdbzItem entity) {
        return itemSerevice.getItemList(entity);
    }

    @Override
    public LdbzResult getItemPage(LdbzItem entity, int page, int limit) {
        return itemSerevice.getItemPage(entity, page, limit);
    }

    @Override
    public LdbzResult deleteByKey(String id) {
        return itemSerevice.deleteByKey(id);
    }

    @Override
    public LdbzResult insertByEntity(LdbzItem entity) {
        return itemSerevice.insertByEntity(entity);
    }

    @Override
    public LdbzResult updateByEntity(LdbzItem entity) {
        return itemSerevice.updateByKey(entity);
    }

    @Override
    public LdbzResult syncItemToESByCode(long code) {
        return null;
    }
}
